def main():
    a=int(input())
    b=(a%10)**3+(a//10%10)**3+(a//100%10)**3
    print(a==b)
main()